var log = window.console;
window.Logger = {
	log:function(info){
		if(info!=null){
			chrome.runtime.sendMessage(info);
		}
	}
};
window.console = {
	log:function(info){
		log.log(info);
		Logger.log(info);
	}
};

chrome.runtime.onMessage.addListener(function(el,sender,response){
	if(typeof el !== 'string'){return;}
	try {
		var result =  eval(el);
		if(result !== undefined){
			response(result);
		}
	}catch (e){
		response(e.message);
	}
});